<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/amazeui.min.css"/>
		<link rel="stylesheet" type="text/css" href="{$_C.hy_path}css/hy.admin.css"/>
	</head>
	<body>
	<div class="am-g">
		 {include file='../Common/hy_header.html'}
		<div class="am-tabs am-margin" data-am-tabs="">
    <ul class="am-tabs-nav am-nav am-nav-tabs">
      <li class="am-active"><a hidefocus="true" href="#tab1">文章详情</a></li>
       {if $_C.DIGLOSSIA==1}
       <li><a hidefocus="true" href="#tab4">英文详情</a></li>
      <li class=""><a hidefocus="true" href="#tab5">相册集</a></li>
       {/if}
      <li class=""><a hidefocus="true" href="#tab2">高级选项</a></li>
      <li class=""><a hidefocus="true" href="#tab3">SEO 选项</a></li>
    </ul>


    <form class="am-tabs-bd am-form hy-js-form" style="touch-action: pan-y; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
      
      <div class="am-tab-panel am-fade am-active am-in" id="tab1">
          <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
              文章标题
            </div>
            <div class="am-u-sm-4 am-u-end">
              <input type="text" name="title" value="{$art.title}" class="am-input-sm">
            </div>
          </div>

          

          <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
              内容摘要
            </div>
            <div class="am-u-sm-4 am-u-end">
               <textarea rows="3" name="summary" placeholder="不填写则自动截取内容前255字符">{$art.summary}</textarea>
            </div>
          </div>

          <div class="am-g am-margin-top-sm">
            <div class="am-u-sm-2 am-text-right">
              内容详情
            </div>
            <div class="am-u-sm-10">
              <textarea class="hy-kindeditor" name="content" rows="10" placeholder="">{$art.content}</textarea>
            </div>
          </div>
<div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
              文章作者
            </div>
            <div class="am-u-sm-4 am-u-end">
              <input value="{$art.author}" name="author" type="text" class="am-input-sm">
            </div>
          </div>
      </div>
      <div class="am-tab-panel am-fade" id="tab4">
          <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
              文章标题
            </div>
            <div class="am-u-sm-4 am-u-end">
              <input type="text" name="en_title" value="{$art.en_title}" class="am-input-sm">
            </div>
          </div>
          <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
              内容摘要
            </div>
            <div class="am-u-sm-4 am-u-end">
               <textarea rows="3" name="en_summary" placeholder="不填写则自动截取内容前255字符">{$art.en_summary}</textarea>
            </div>
          </div>

          <div class="am-g am-margin-top-sm">
            <div class="am-u-sm-2 am-text-right">
              内容详情
            </div>
            <div class="am-u-sm-10">
              <textarea class="hy-kindeditor" name="en_content" rows="10" placeholder="">{$art.en_content}</textarea>
            </div>
          </div>
<div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
              文章作者
            </div>
            <div class="am-u-sm-4 am-u-end">
              <input type="text" name="en_author" value="{$art.en_author}" class="am-input-sm">
            </div>
          </div>
      </div>
      <div class="am-tab-panel am-fade " id="tab2">
         <div class="am-g am-margin-top">
          <div class="am-u-sm-2 am-text-right">所属类别</div>
          <div class="am-u-sm-4 am-u-end">
            <select name="cat_id">
              {foreach from=$parent_list item=list} 
               <option {if $art.cat_id==$list.id} selected="selected"{elseif $list.id==$_GET['c']}selected="selected"{/if} value="{$list.id}">{$list.name}</option>
              {/foreach}   
            </select>
          </div>
        </div>
<!--         <div class="am-g am-margin-top">
          <div class="am-u-sm-2 am-text-right">推荐类型</div>
          <div class="am-u-sm-10">
            <div class="am-btn-group" data-am-button>
            	
              <label class="am-btn am-btn-default am-btn-xs {foreach from=$art.flags item=flag} {if $flag==0}am-active{/if}{/foreach}">
                <input type="checkbox" name="flags" value="0" {foreach from=$art.flags item=flag} {if $flag==0}checked="checked"{/if}{/foreach} > 热门
              </label>
              <label class="am-btn am-btn-default am-btn-xs {foreach from=$art.flags item=flag} {if $flag==1}am-active{/if}{/foreach}">
                <input type="checkbox" name="flags" value="1"  {foreach from=$art.flags item=flag} {if $flag==1}checked="checked"{/if}{/foreach} > 置顶
              </label>
              <label class="am-btn am-btn-default am-btn-xs {foreach from=$art.flags item=flag} {if $flag==2}am-active{/if}{/foreach} ">
                <input type="checkbox" name="flags" value="2"  {foreach from=$art.flags item=flag} {if $flag==2}checked="checked"{/if}{/foreach} > 推荐
              </label>
              <label class="am-btn am-btn-default am-btn-xs {foreach from=$art.flags item=flag} {if $flag==3}am-active{/if}{/foreach}">
                <input type="checkbox" name="flags" value="3"  {foreach from=$art.flags item=flag} {if $flag==3}checked="checked"{/if}{/foreach}> 图片
              </label>
              <label class="am-btn am-btn-default am-btn-xs {foreach from=$art.flags item=flag} {if $flag==4}am-active{/if}{/foreach}">
                <input type="checkbox" name="flags" value="4"  {foreach from=$art.flags item=flag} {if $flag==4}checked="checked"{/if}{/foreach} > 其他
              </label>
            </div>
          </div>
        </div>
        <div class="am-g am-margin-top">
          <div class="am-u-sm-2 am-text-right">显示状态</div>
          <div class="am-u-sm-10">
            <div class="am-btn-group" data-am-button="">
              <label class="am-btn am-btn-default am-btn-xs {if $art.is_show}{if $art.is_show eq 1}am-active{else}{/if}{else}am-active{/if}  ">
                <input type="radio"  {if $art.is_show}{if $art.is_show eq 1}checked="checked"{else}{/if}{else}checked="checked"{/if}  name="is_show"  value="1" id="option1"> 显示
              </label>
              <label class="am-btn am-btn-default am-btn-xs {if $art.is_show}{if $art.is_show eq 0}am-active{else}{/if}{else}{/if}">
                <input type="radio" {if $art.is_show}{if $art.is_show eq 0}checked="checked"{else}{/if}{else}{/if} name="is_show" value="0" id="option2"> 不显示
              </label>
            </div>
          </div>
        </div> 

       

          <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
              信息来源
            </div>
            <div class="am-u-sm-4">
              <input name="source_url" value="{$art.source_url}" type="text" class="am-input-sm">
            </div>
            <div class="am-u-sm-6">选填</div>
          </div>
		  -->
 <div class="am-g am-margin-top">
            <div class="am-u-sm-2 am-text-right">
              上传图片
            </div>
            <div class="am-u-sm-4">
              <input type="text" name="thumb" class="am-input-sm" value="{$art.thumb}">
             
            </div>
            <div class="am-u-sm-1">
            	 <img id="hy-thumb" style="height: 30px;" {if $art.thumb}src="{$art.thumb}"{else} src="{$_C.hy_path}images/logo2.png" {/if}>
            	</div>
             <div class="am-u-sm-4 am-u-end">
             	<button class="am-btn am-btn-primary am-btn-xs hy-js-uploadimg" >上传</button>
          </div>
             </div>
 <!--       <div class="am-g am-margin-top">
          <div class="am-u-sm-2 am-text-right">关联表单</div>
          <div class="am-u-sm-4 am-u-end">
            <select name="form_id">
            	<option value="0">不关联表单</option>
              {foreach from=$forms_list item=list} 
               <option {if $art.form_id==$list.id} selected="selected"{elseif $list.id==$_GET['c']}selected="selected"{/if} value="{$list.id}">{$list.name}</option>
              {/foreach}   
            </select>
          </div>
        </div> -->
        <div class="am-g am-margin-top">
          <div class="am-u-sm-2 am-text-right">
            发布时间
          </div>
          <div class="am-u-sm-4 am-u-end">
              <div class="am-form-group am-form-icon">
                <i class="am-icon-calendar"></i>
                <input name="created" data-am-datepicker value="{$art.created|date_format:'%Y-%m-%d'}" type="text" class="am-form-field am-input-sm" placeholder="时间">
              </div>
          </div>
        </div>
      </div>
      <div class="am-tab-panel am-fade" id="tab5">
      	    <button class="am-btn am-btn-primary am-btn-xs hy-js-uploadimg2" >上传</button>
      	   <ul id="hy-img-ul">
      	   	{foreach from=$art.photo item=photo}
      	   	<li class="hy-img-li">
      	   		<div  class="hy-img-container am-text-right "><span data-param ="{ url:'index.php?g=admin&m=article&a=del_photo&id={$photo.id}',hide:2}" class="hy-js-del am-icon-close"></span><img data-href="index.php?g=admin&m=article&a=edit_photo&pid={$photo.id}" class="hy-js-img" title="{$photo.title}" alt="{$photo.title}" width="100%" src="{$photo.original_pic}"/></div>
      	   	</li>
      	   	{/foreach}
      	   </ul>
      </div>
      <div class="am-tab-panel am-fade" id="tab3">
          <div class="am-g am-margin-top-sm">
            <div class="am-u-sm-2 am-text-right">
              SEO 标题
            </div>
            <div class="am-u-sm-4 am-u-end">
              <input type="text" name="page_title" value="{$art.page_title}" class="am-input-sm">
            </div>
          </div>

          <div class="am-g am-margin-top-sm">
            <div class="am-u-sm-2 am-text-right">
              SEO 关键字
            </div>
            <div class="am-u-sm-4 am-u-end">
              <input name="keywords" value="{$art.keywords}" type="text" class="am-input-sm">
            </div>
          </div>

          <div class="am-g am-margin-top-sm">
            <div class="am-u-sm-2 am-text-right">
              SEO 描述
            </div>
            <div class="am-u-sm-4 am-u-end">
              <textarea name="abstract" rows="4">{$art.abstract}</textarea>
            </div>
          </div>
      </div>
 <input type="hidden" name="id" value="{$id}" />
    </form>
    <div class="am-margin">
    <button type="button" class="am-btn am-btn-primary hy-js-submit am-btn-xs">提交保存</button>
    
  </div>
  </div>
	</div>	
	 
	  {include file='../Common/hy_footer.html'}
	<script type="text/javascript" src="{$_C.hy_path}js/editor/kindeditor.js"></script>
	<script type="text/javascript">
	    hy_uploadimg('/article',{},function(result){
	    	if(typeof(result[0])!='undefined')
	    	{
	        	$('#hy-thumb').attr('src',result[0]);
	        	$('input[name=thumb]').val(result[0]).focus();
	       }
	    })
	    hy_uploadimg('/photo',{ target:'.hy-js-uploadimg2'},function(result){
	    	var html='';
	    	if(typeof(result[0])!='undefined')
	    	{
	    		for(res in result)
	    		{
	    			html+='<li class="hy-img-li"><div class="hy-img-container am-text-right"><span data-param ="{ hide:2}" class="hy-js-del am-icon-close"></span><img width="100%" src="'+result[res]+'"/></div><input name=photo type="hidden" value="'+result[res]+'"/></li>'
	    		}
	        	$('#hy-img-ul').append(html);
	        	
	       }
	    })
	    hy_submit('index.php?g=admin&m=article&a={$action}');
		hungry.kindEditor.editor();
	</script>
	</body>
</html>
